#include <ezwin.h>
#include <cmath>
#include <cassert>
#include "rect.h"
SimpleWindow window("GraphPlotter",28.0,20.0,Position(1.0,0.0));
int ApiMain()
{
float x,a=5.0,b=4.0,y,y1;
float i;
window.Open();
assert(window.GetStatus() == WindowOpen);
window.RenderLine(Position(14,0.0),Position(14.0,20.0),Black,0.0);
window.RenderLine(Position(0.0,10.0),Position(28.0,10.0),Black,0.0);
window.RenderLine(Position(7.0,0.0),Position(7.0,10.0),Red,0.0);
window.RenderLine(Position(0.0,5.0),Position(14.0,5.0),Red,0.0);
for(i=-3.5;i<=3.5;i+=.0001)
{
y=sin(i);
window.RenderLine(Position(7.0,5.0)+Position(i,-y),Position(7.0,5.0)+Position(i,-y),Blue,0.0);

}
window.RenderLine(Position(21.0,0.0),Position(21.0,10.0),Red,0.0);
window.RenderLine(Position(0.0,5.0),Position(28.0,5.0),Red,0.0);
for(i=-5;i<=5;i+=.0001)
{

y=(b/a)*sqrt(a*a-i*i);
y1=-(b/a)*sqrt(a*a-i*i);
window.RenderLine(Position(21.0,5.0)+Position(i,-y),Position(21.0,5.0)+Position(i,-y),Cyan,0.0);
window.RenderLine(Position(21.0,5.0)+Position(i,-y1),Position(21.0,5.0)+Position(i,-y1),Cyan,0.0);

}
i=4;
y=(b/a)*sqrt(a*a-i*i);

window.RenderLine(Position(21.0,5.0),Position(21.0,5.0)+Position(i,-y),Black,0.0);
for(i=1;i>=0.89;i-=0.001)
{
y=sqrt(1-i*i);

window.RenderLine(Position(21.0,5.0)+Position(i,-y),Position(21.0,5.0)+Position(i,-y),Black,0.0);
}
window.RenderLine(Position(7.0,10.0),Position(7.0,20.0),Red,0.0);

}

